//
//  TTFirstViewController.m
//  tiantu_offer
//
//  Created by zwb on 16/5/14.
//  Copyright © 2016年 zwb. All rights reserved.
//

#import "TTFirstViewController.h"
#import "AppDelegate.h"


@interface TTFirstViewController ()<UIScrollViewDelegate>
{
    UIImageView *lastimageview;
}
@end


#define DURATION 0.25

@implementation TTFirstViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = kBackGColor;
    [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;
    UIScrollView *mainscroll = [[UIScrollView alloc] initWithFrame:self.view.bounds];
    [self.view addSubview:mainscroll];
    mainscroll.delegate = self;
    mainscroll.bounces = NO;
    mainscroll.pagingEnabled = YES;
    mainscroll.showsHorizontalScrollIndicator = NO;
    mainscroll.showsVerticalScrollIndicator = YES;
    mainscroll.contentSize = CGSizeMake(SCREEN_WIDTH*2, SCREEN_HEIGHT);
    

    
    for (int i = 0; i < 2; i++) {
        UIImageView *imageview = [[UIImageView alloc] initWithFrame:CGRectMake(SCREEN_WIDTH * i, 0, SCREEN_WIDTH, SCREEN_HEIGHT)];
        imageview.image = [UIImage imageNamed:[NSString stringWithFormat:@"0%d.png",i+1]];
        [mainscroll addSubview:imageview];
        if (i == 1)
        {
            lastimageview = imageview;
            [imageview setUserInteractionEnabled:YES];
            
            [imageview addGestureRecognizer:[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(removepress:)] ];
            
            UILabel *label = [MyControlUilt createLabelWithFrame:CGRectMake((SCREEN_WIDTH-130)/2.0, SCREEN_HEIGHT-245, 130, 40) labelText:@"立即体验" backColor:nil Font:FONT16 TextColor:kWhiteColor SuperView:imageview];
            label.textAlignment = NSTextAlignmentCenter;
            label.layer.borderColor = kWhiteColor.CGColor;
            label.layer.borderWidth = 1.0;
            label.layer.cornerRadius = 5;

        }
    }
}


-(void)removepress:(UITapGestureRecognizer *)sender
{
    AppDelegate *delegate = [UIApplication sharedApplication].delegate;
    [delegate gotoMainView];
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
